package com.lyy.client;

import com.lyy.config.SpringConfiguration;
import com.lyy.service.IAccountService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * 使用纯注解配置时的测试类
 */
public class Test2 {
    @Test
    public void testTransfer(){
        ApplicationContext context= new  AnnotationConfigApplicationContext(SpringConfiguration.class);
        IAccountService accountService = context.getBean(IAccountService.class);
        try {
            String result = accountService.transfer("13b8e5e633908d71d90ea55de3f5e638", "a8af7ca39544044e2850ee82f365723a", 100);
            System.out.println(result);
        } catch (Exception e) {
            e.printStackTrace();
            System.out.println("转账发生了异常");
        }
    }
}
